package com.trkj.dao.jpa;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import com.trkj.pojos.JlElectronicePrint;

public interface IjlElectronicePrintDAO extends CrudRepository<JlElectronicePrint, Long> {
	@Query("select s from JlElectronicePrint s where ierId=?1")
	public List<JlElectronicePrint> findElectronicePrintByPage(Pageable pageable,BigDecimal sex);
	@Query("select s from JlElectronicePrint s")
	public List<JlElectronicePrint> findElectronicePrintByPage(Pageable pageable);
	@Query("select s from JlElectronicePrint s where ierId=?1")
	public List<JlElectronicePrint> findbyerid(BigDecimal sex);
	@Query("select max(erId) from JlElectronicePrint ")
	public long findMaxelePritid();
	@Query("select erOpenTime from JlElectronicePrint where erId=?1")
	public Date MaxelePritidToDate(Long erId);
	@Query("select s from JlElectronicePrint s where s.ierId=?1 and s.state='未取药'")
	public  List<JlElectronicePrint> idToElectronicePrint( BigDecimal  ZierId);		
	
	//查询未完成的处方单
	@Query("select s from JlElectronicePrint s where s.state='未完成'")
	public List<JlElectronicePrint> findByNoSucess();
}
